# -*- coding: utf-8 -*-
import  os
class access():
    def __init__(self,path):
        self.path=path
        pass

    def isWOk(self):
        if not (self.isFile() or self.isDir()):
            return False
        return os.access(self.path,os.W_OK)
        pass



    def isROk(self):
        if not (self.isFile() or self.isDir()):
            return False
        return os.access(self.path,os.R_OK)
        pass

    def isEOk(self):
        if not (self.isFile() or self.isDir()):
            return False
        return os.access(self.path,os.X_OK)

    def isFile(self):
        return os.path.isfile(self.path)

    def isDir(self):
        return os.path.isdir(self.path)



if __name__ == "__main__":
    path = access("C:\\")
    print("isFile()" , path.isFile())
    print(path.isDir())
    print(path.isEOk())
    print(path.isROk())
    print(path.isWOk())
    path = access("D:\\")
    print("isFile()", path.isFile())
    print(path.isDir())
    print(path.isEOk())
    print(path.isROk())
    print(path.isWOk())
    path = access("accessFile.py")
    print('path = access("accessFile.py")')
    print(path.isDir())
    print(path.isFile())
    print(path.isEOk())
    print(path.isROk())
    print(path.isWOk())